package com.atbeijing.bigdata.spark.mytest.sql

import org.apache.spark.SparkConf
import org.apache.spark.sql.{DataFrame, SparkSession}

object My_DataFrame {
  def main(args: Array[String]): Unit = {
    val conf: SparkConf = new SparkConf().setMaster("local[*]").setAppName("df")
    val ss: SparkSession = SparkSession.builder().config(conf).getOrCreate()
    import ss.implicits._


    val df: DataFrame = ss.read.json("data/user.json")

    df.createTempView("user")

    //SQL
    //ss.sql("select * from user").show()

    //DSL
    //df.select($"age"+10).show()



  }

}
